package com.spring.demo5;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

public class Profile {
	@Autowired
	@Qualifier("student3")//注释后会注入student Bean
	private Student student;
	public Profile(){
	System.out.println("构造器初始化 Profile constructor." );
	}
	public void printAge() {
	System.out.println("Age : " + student.getAge() );
	}
	public void printName() {
	System.out.println("Name : " + student.getName() );
	}
}
